home *** CD-ROM | disk | FTP | other *** search
/ PC World 2007 December / PCWorld_2007-12_cd.bin / domacnost a kancelar / autoit / autoit-v3-setup.exe / Examples / Helpfile / _SQLite_Exec.au3 < prev    next >
Text File  |  2007-09-08  |  724b  |  26 lines

  1. #include <sqlite.au3>
  2. #include <sqlite.dll.au3>
  3.  
  4. Local $hQuery,$aRow
  5. _SQLite_Startup()
  6. _SQLite_Open()
  7. ; Whithout $sCallback its an Resultless query
  8. _SQLite_Exec(-1,"Create table tblTest (a,b int,c single not null);" & _
  9.                 "Insert into tblTest values ('1',2,3);" & _
  10.                 "Insert into tblTest values (Null,5,6);")
  11.  
  12. $d = _SQLite_Exec(-1,"Select oid,* From tblTest","_cb") ; _cb Will be called for each row
  13. Func _cb($aRow)
  14.     For $s In $aRow
  15.         ConsoleWrite($s & @TAB)
  16.     Next
  17.     ConsoleWrite(@LF)
  18.     ; Return $SQLITE_ABORT ; Would Abort the process and trigger an @error in _SQLite_Exec()
  19. EndFunc
  20. _SQLite_Close()
  21. _SQLite_Shutdown()
  22.  
  23. ; Output:
  24. ;~     rowid    a    b    c    
  25. ;~     1        1    2    3    
  26. ;~     2            5    6